-
Notifications
You must be signed in to change notification settings - Fork 0
[CORRUPTED] Synthetic Benchmark PR #103102 - feat(tracemetrics): Parse metric from aggregations #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: base_pr_103102_20251204_6705
Are you sure you want to change the base?
[CORRUPTED] Synthetic Benchmark PR #103102 - feat(tracemetrics): Parse metric from aggregations #16
Conversation
This parses the metric from aggregations instead of relying on the top level metric name/type. The top level ones still take precendence for better compatibility. It has the limitation that it only allows a single metric across all the aggregations.
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||
User description
Benchmark PR getsentry#103102
Type: Corrupted (contains bugs)
Original PR Title: feat(tracemetrics): Parse metric from aggregations
Original PR Description: This parses the metric from aggregations instead of relying on the top level metric name/type. The top level ones still take precedence for better compatibility. It has the limitation that it only allows a single metric across all the aggregations.
Original PR URL: getsentry#103102
PR Type
Enhancement
Description
Parse metric metadata from aggregation functions instead of relying solely on top-level metric parameters
Extract metric name, type, and unit from selected columns and equations to automatically filter trace metrics
Refactor metric filtering logic into reusable utility functions and configuration methods
Add validation to prevent querying multiple different metrics in a single request
Diagram Walkthrough
File Walkthrough
columns.py
Add metric metadata extraction to aggregatessrc/sentry/search/eap/columns.py
ResolvedMetricAggregatedataclass to store metric metadata (name,type, unit) extracted from aggregations
castutility andMetricTypefrom types moduleTraceMetricAggregateDefinition.resolve()to extract and returnmetric information from aggregation arguments
ResolvedAggregatetoResolvedMetricAggregatewith populated metric fields
resolver.py
Refactor query resolution with dataset conditionssrc/sentry/search/eap/resolver.py
and_trace_item_filters()utility function
resolve_query_with_columns()method that callsresolve_dataset_conditions()to inject dataset-specific filtersresolve_dataset_conditions()to delegate to config'sextra_conditions()method with selected columns and equationsresolve_query()to use the new utility function for filtermerging
rpc_utils.py
Add trace item filter utility functionssrc/sentry/search/eap/rpc_utils.py
and_trace_item_filters()functionmultiple filters with AND logic
TraceItemFilterwithAndFilterconfig.py
Extract metrics from aggregations with fallbacksrc/sentry/search/eap/trace_metrics/config.py
MetricTypedefinition from local totypes.pymoduleMetricdataclass to represent metric with name, type, and unitextra_conditions()to acceptselected_columnsandequationsparameters
_extra_conditions_from_metric()to handle top-level metric configfiltering
_extra_conditions_from_columns()to extract metrics fromaggregation functions and equations
get_metric_filter()as standalone function to build filterconditions for a metric
InvalidSearchQuerywhen multiple differentmetrics are detected
types.py
Update config interface and centralize typessrc/sentry/search/eap/types.py
extra_conditions()signature to acceptselected_columnsandequationsparametersMetricTypetype alias definition from trace_metrics config tothis module
MetricTypeasLiteral["counter", "gauge", "distribution"]rpc_dataset_common.py
Use centralized filter utilities and new query resolutionsrc/sentry/snuba/rpc_dataset_common.py
and_trace_item_filtersfrom newrpc_utilsmoduleget_table_rpc_request()to callresolve_query_with_columns()instead of
resolve_query()and_trace_item_filters()function definition (movedto rpc_utils)
get_timeseries_query()to callresolve_query_with_columns()with selected axes and equations
extra_conditionscalls fromrun_top_events_timeseries_query()as they are now handled internallytrace_metrics.py
Remove redundant extra conditions handlingsrc/sentry/snuba/trace_metrics.py
extra_conditionscalls fromrun_table_query()andrun_timeseries_query()extra_conditionsparameter fromTableQuerycallstest_organization_events_trace_metrics.py
Update tests for metric aggregation changestests/snuba/api/endpoints/test_organization_events_trace_metrics.py
-instead ofnonefor metric unitparameter in aggregation functions